// pages/mine/mine.js
Page({
 
  /**
  * 页面的初始数据
  */
  data: {
    particulars:'',
    goodList:[],
    phones:[
      {
        tell:'18428081047'
      },
      {
        tell:'15182068113'
      },
      {
        tell:'18882061088'
      }
    ],
    tells:[
      {
        name:'林小小',
        url:'  https://pic1.ajkimg.com/display/anjuke/2164edf0a3dd6253066d7d270e899174/1879x2494x93x7/100x133.jpg',
        txt:'带看15次好评率5.0',
        slogan:'“随时为您提供服务”'
      },
      {
        name:'何召召',
        url:'https://pic1.ajkimg.com/display/anjuke/9eeff48b624be5550c0c10f34fd04bbb/1627x2160x266x0/100x133.jpg',
        txt:'带看39次好评率5.0',
        slogan:'“随时为您提供服务”'
      },
      {
        name:'高美丽',
        url:' https://pic1.ajkimg.com/display/anjuke/0b6872d4de8b19184a25ec4272d1f60e/780x1035x0x10/100x133.jpg',
        txt:'好评率4.6',
        slogan:'“期待带您实地讲解”'
      }
    ],
    lable:[
      "免物业费",
      "木棉6.0",
      "阳台独立",
      "非首次出租",
      "离地铁近"
    ],
  /*自定义轮播图 配置*/
  slider: [
    { 
    id: '0',
    name:'卧室',
     picUrl: '//imgpro.ziroom.com/49bba6b7-b7ff-47f3-907e-b2b526b05446_427.jpg_C_800_600_Q90.jpg' 
    },
   { 
     id: '0',
    name:'公共卫生间',
    picUrl: '//imgpro.ziroom.com/c59bddf6-3717-4b03-bd8b-24bd37331eff_549.jpg_C_800_600_Q90.jpg' 
  },
  {
     id: '0',
     name:'起居室',
   picUrl: '//imgpro.ziroom.com/88fd291e-d6b8-467d-83e4-335e9f4658ce_915.jpg_C_800_600_Q90.jpg'
   },
   {
    id: '0',
    name:'厨房',
  picUrl: '//imgpro.ziroom.com/af424339-ab30-44f6-b7a8-b15283932518_257.jpg_C_800_600_Q90.jpg'
  }
  ],
  swiperCurrent: 0
  },
  
  /**
  * 生命周期函数--监听页面加载
  */
  onLoad: function (options) {
    //接受页面传递的参数
    let particulars = JSON.parse(options.particulars);
    let goodList = JSON.parse(options.goodlist)
    this.setData({
      particulars:particulars,
      goodList:goodList
    })
  },
  
  //轮播图的切换事件 
  swiperChange: function (e) {
  //只要把切换后当前的index传给<swiper>组件的current属性即可 
  this.setData({
  swiperCurrent: e.detail.current
  })
  },
  //点击指示点切换 
  chuangEvent: function (e) {
  this.setData({
  swiperCurrent: e.currentTarget.id
  })
  },
  //点击返回箭头返回上一级
  backBtn(){
    wx.switchTab({
      url:"/pages/index/index"
    })
  },
  //拨打电话
  callBtn(e){
    let index = parseInt(e.currentTarget.dataset.index);
    wx.makePhoneCall({
      phoneNumber: this.data.phones[index].tell,
    })
  }
 })